<!DOCTYPE html>
<html>
	<head>
		<title>流程配置一览页</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	<body>
		<fieldset class="scheduler-border" ng-if="showGlobalConf" name="flowConfFieldset">
			<legend style="width: 90px; border-bottom: 0; margin-bottom: 10px;">
				<span>流程配置</span>
			</legend>
			<div title="全局表单设置 "  style="width:100%;padding:5px;" >
				<div title="全局表单" type="global" bpm-form="overallView.definitionConf.globalForm" mobile-form="overallView.definitionConf.globalMobileForm" ></div>
				<div title="实例表单" type="instance" bpm-form="overallView.definitionConf.instForm"></div>
			</div>
			<table class="table table-bordered" >
		          <tr ng-repeat="bo in overallView.definitionConf.boDef.boDefs">
		          		<th>BO配置</th> <td>{{bo.name}}</td> <td>{{bo.key}}</td> <td>{{bo.saveMode}}</td> 
		          </tr>
			</table>
			
			<table class="table table-bordered" title="节点初始化脚本">
				<thead><th>初始化脚本节点</th><th>打开节点任务时执行脚本</th><th>完成节点任务时执行脚本</th></thead>
		        <tbody>
		          <tr ng-if="!overallView.definitionConf.bpmFormInit.formInitItems.length"><td>流程尚未配置节点初始化内容</td></tr>
		          <tr ng-repeat="formInit in overallView.definitionConf.bpmFormInit.formInitItems" id="aaformInitScript">
		          		<td>{{formInit.nodeId}}</td>
		          		<td>
		          			<div class="easyui-accordion" ng-repeat="setting in formInit.showFieldsSetting" >
								<div title="{{setting.description}}" style="overflow:auto;padding:5px;">
									<textarea disabled="disabled" ab-trim ng-model="setting.setting" rows="2" class="form-control"></textarea>
								</div>
		          			</div>
		          			
		          		</td> 
		          		<td>
		          			<div class="easyui-accordion" ng-repeat="saveSetting in formInit.saveFieldsSetting" >
								<div title="{{showSetting.description}}" style="overflow:auto;padding:5px;">
									<textarea disabled="disabled" ab-trim ng-model="saveSetting.setting" rows="2" class="form-control"></textarea>
								</div>
		          			</div>
						</td> 
		          </tr>
		        </tbody>
		   </table>
		</fieldset>
		
		<fieldset class="scheduler-border" ng-repeat="nodeConf in overallView.nodeConfs" ng-if="nodeConf.nodeType !='parallelGateway'" name="{{nodeConf.nodeId}}Fieldset">
			<legend style="width: 320px; border-bottom: 0; margin-bottom: 10px;">
				<div style="text-align: center;">{{nodeConf.nodeName}}一 {{nodeConf.nodeId}}</div>
			</legend>
		  	<div ng-if="nodeConf.nodeType=='userTask' ||nodeConf.nodeType=='start' ||nodeConf.nodeType=='end'">
				<div title="表单设置 " ab-tip="{position:{my:'bottom center',at:'top center'}}" style="width:100%;padding:5px;" ng-if="showForm">
					   <div title="节点表单" type="node" bpm-form="nodeConf.form" mobile-form="nodeConf.mobileForm" ></div>
				</div>
				
				<!-- 人员 -->
				<div title="人员配置 " ab-tip="{position:{my:'bottom center',at:'top center'}}" ng-show="showUserConf">
					<table class="table table-bordered">
				        <tbody>
				          <tr ng-if="!nodeConf.userConfs.length"><td>尚未配置人员设置</td></tr>
				          <tr ng-repeat="userConf in nodeConf.userConfs"> 
				          		<td style="width: 200px">{{userConf.description}}</td>
				          		<td><textarea style="max-width: 1100px!important" ab-show-json="false" ng-model="userConf.calcs" disabled="disabled" class="form-control">{{userConf.bpmPluginDef.script}}</textarea></td> 
				          </tr>
				        </tbody>
				   </table>
			   </div>
			     <!-- 前后脚本 -->
			   <table class="table-form" ng-if="nodeConf.nodeType=='userTask' && showScript" >
			        <tbody>
			          <tr id="{{nodeConf.nodeId}}-nodeScript">  
			          		<td ab-tip="{position:{my:'bottom center',at:'top center'}}" title="任务创建时脚本"> <textarea ng-model="nodeConf.scriptMap.CREATE" ab-trim rows="2" class="form-control"></textarea>  </td> 
			          		<td ab-tip="{position:{my:'bottom center',at:'top center'}}" title="任务完成时脚本"> 
			          			<textarea id="{{nodeConf.nodeId}}" ab-trim ng-model="nodeConf.scriptMap.COMPLETE" rows="2" class="form-control"></textarea>
			          		</td>
			          </tr>
			        </tbody>
			   </table>
			   <table class="table-form" ng-if="nodeConf.nodeType=='start' && showScript">
			    
			        <tbody>
			          <tr id="{{nodeConf.nodeId}}-nodeScript"> <td ab-tip="{position:{my:'bottom center',at:'top center'}}"  title="流程创建时脚本"> <textarea ab-trim ng-model="nodeConf.scriptMap.START" rows="2" class="form-control"></textarea>  </td> </tr>
			        </tbody>
			   </table>
			   <table class="table-form" ng-if="nodeConf.nodeType=='end' && showScript" >
			        <tbody>
			          <tr id="{{nodeConf.nodeId}}-nodeScript"> <td ab-tip="{position:{my:'bottom center',at:'top center'}}"  title="流程完成时执行脚本"> <textarea ab-trim rows="2" ng-model="nodeConf.scriptMap.END" class="form-control"></textarea>  </td> 
			          	   <td ab-tip="{position:{my:'bottom center',at:'top center'}}"  title="流程人工结束时执行脚本"> <textarea ab-trim rows="2" ng-model="nodeConf.scriptMap.MANUALEND"  class="form-control"></textarea></td></tr>
			        </tbody>
			   </table>
			    <!-- 跳转脚本 -->
			   <table class="table table-bordered" title="跳转脚本 " ng-if="nodeConf.jumpRules.length && showNodeSkip">
			        <tbody>
			        	<tr><th>自由跳转脚本描述</th><th>跳转目标节点</th><th>跳转条件脚本</th></tr>
			          <tr ng-repeat="jumpRule in nodeConf.jumpRules" id="xxnodeSkipScript"> 
			          	<td>{{jumpRule.ruleName}}</td> <td>{{jumpRule.targetNode}}</td> 
			          	<td><textarea  class="form-control" ab-trim ng-model="jumpRule.condition"></textarea></td> 
			          	
			          </tr>
			        </tbody>
			   </table>
		  		<div  title="节点按钮  ——下面仅展示含脚本的按钮（点击按钮编辑脚本）"  style="width:100%;padding:5px;" ng-if="showBtn">
			     	<div> 
			     		 <button ng-repeat="btn in nodeConf.buttons" type="button" class="btn btn-sm btn-success" ng-click="changeShowBtn(nodeConf.buttons)">{{btn.name}}</button>
					   	<table class="table table-bordered" >
					   		<thead> <tr><th>按钮名字</th><th>动作</th><th>前置js脚本</th><th style="width: 120px">后置js脚本</th><th>展示前groovy脚本</th></thead>
					          <tr id="{{nodeConf.nodeId}}nodeBtnScript" ng-repeat="btn in nodeConf.buttons"  ng-show="btn.beforeScript || btn.afterScript || btn.groovyScript || btn.isShow"> 
					          		<td>{{btn.name}}</td><td>{{btn.alias}}</td>
					          		<td><textarea rows="1" ab-trim ng-model="btn.beforeScript" class="form-control"></textarea></td> 
					          		<td><textarea rows="1" ab-trim ng-model="btn.afterScript"  class="form-control"></textarea></td>
					          		<td><textarea rows="1" ab-trim ng-model="btn.groovyScript" class="form-control"></textarea></td>
					          </tr>
					   </table>
			  		</div>
		  		</div>
		  	</div>
	  		<div ng-if="(nodeConf.nodeType=='exclusiveGateway' || nodeConf.nodeType =='inclusiveGateway') && isShowGateway">
			   	<table class="table table-bordered"  title="网关条件" ab-tip="{position:{my:'bottom center',at:'top center'}}">
			          <tr ng-repeat="(nodeId,script) in nodeConf.gatewayScript" id="xxgatewayScript">
			          	<th>目标节点：{{nodeId}} </th>
			          	<td> <textarea rows="2" ng-model="nodeConf.gatewayScript[nodeId]" class="form-control"></textarea></td>
			          </tr>
			   </table>
	  		</div>
	  	</fieldset>
	</body>
</html>
<style>
 .table {margin-bottom: 5px;}
 textarea{
 	max-width: 630px
 }
 th{
 	text-align: center !important;
 }
fieldset.scheduler-border {
    border: 2px groove #ddd !important;
    padding: 0 0.4em 1.4em 0.4em !important; 
    /* margin: 0 0 1.5em 0 !important; */
    -webkit-box-shadow:  0px 0px 0px 0px #000;
}
legend{
	font-size:18px!important;
	padding: initial;
	margin: 10px;
}
fieldset{
	margin:5px!important;
}
legend.scheduler-border {
    font-size: 1.2em !important;
    font-weight: bold !important;
    text-align: left !important;
}
.btn-success{margin:5px 0 0 5px;}
</style>